﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Landscape.Business.Common;

namespace Landscape.WebApp.Controls
{
    public partial class ActionResponse : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Request.QueryString["r"] != null)
                {
                    var qry = Utils.Base64Decrypt(Request.QueryString["r"]);
                    string[] parts = qry.Split('|');
                    hfAction.Value = parts[1];

                    switch (parts[1].ToLower())
                    {
                        case "respond":
                        case "rework":
                            {
                                this.pnlResponse.Enabled = true;
                                break;
                            }

                        case "review":
                            {
                                this.pnlReiew.Enabled = true;
                                break;
                            }

                        case "hseqapproval":
                            {
                                this.pnlHseq.Enabled = true;
                                break;
                            }

                        case "odapproval":
                            {
                                this.pnlOD.Enabled = true;
                                break;
                            }

                        default:
                            {
                                break;
                            }
                    }
                }
            }
        }
    }
}